package com.happyclub.paul.dao;

import com.happyclub.pojo.TbLogiinHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @Auther: 魏泉琦
 * @Date: 2019/4/8 20:01
 * @Description:
 */
public interface LogiinHistoryRepostitory extends JpaRepository<TbLogiinHistory,String> {


    /**
     *@Description: 记录用户登录历史
     *@Author: 魏泉琦
     *@date: 2019/4/8
     */
    @Modifying
    @Query( value = "INSERT INTO TB_LOGIIN_HISTORY(ID,USER_ID,LOGIN_TYPE,IEMI,IP,LOGIN_ADDRESS,LOGIN_TIME) VALUES(?1,?2,?3,?4,?5,?6,SYSDATE)",nativeQuery = true)
    Integer createLogiinHistory(String id,String userId,String loginType,String iemi,String ip,String loginAddress);
}
